import { NewItem } from "@/api/news/news";
import { defineStore } from "pinia";
import { ref } from "vue";

export const useNoticeStore = defineStore(
  "useNoticeStore",
  () => {
    const noticeInfo = ref<NewItem>(null);
    const setNoticeItem = (item: NewItem) => {
      noticeInfo.value = item;
    };
    return { noticeInfo, setNoticeItem };
  },
  {
    // 开启本地存储
    persist: {
      enabled: true
    }
  }
);
